import { defineStore } from "pinia";

export const useAppStore = defineStore('user',{
    state() {
        return {
            token:'',
            username:''
        }
    },
    actions:{
            // 设置token
            setLocalstorage(payload){
                // console.log(payload);
                this.token=payload
                // localStorage.setItem('token',thistoken)
            },
            // 设置本地用户名
            setLocalstorageUsername(payload){
                this.username=payload
                // localStorage.setItem('username',thisusername)
            },
        },
        
    persist:true
})